package com.googlecode.saucelabs;

import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;

import com.jcraft.jsch.Session;

/**
 * Goal which touches a timestamp file.
 * 
 * @goal shutdown-tunnel
 * @phase post-integration-test
 */
public class ShutdownTunnelMojo extends AbstractSauceMojo {
	public void execute() throws MojoExecutionException, MojoFailureException {
		Session session = getSession();

		if (null != session) {
			logMessage("Finishing ssh session");

			session.disconnect();
		}
	}
}